//
//  SoundHandler.h
//  
//
//  Created by Fred Havemeyer on 6/22/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#include <stdio.h>
#include <time.h>

#include <CoreFoundation/CoreFoundation.h>
#include <Foundation/Foundation.h>

#import <UIKit/UIKit.h>
#import <UIKit/UIView.h>
#import <UIKit/UIApplication.h>
#import <Celestial/AVController.h>
#import <Celestial/AVQueue.h>
#import <Celestial/AVItem.h>
#import <Celestial/AVController-AVController_Celeste.h>

#define TURN_ON		1
#define TURN_OFF	2
#define	IDLE		3
#define SWING		4
#define	STRIKE		5
#define	HIT			6

@interface SoundHandler : AVController {
	NSError *err;
	BOOL somethingPlaying;
		
	NSString *baseSoundFolderPath;
	
	BOOL	idle,
			swinging,
			striking,
			hitting;
			
	BOOL *turningOn;
	
	/* 
	Sound objects 
	*/
	
	// Turn on and off
	AVItem *turnOn;
	AVItem *turnOff;
	
	// Idle
	AVItem *idle0;
	AVItem *idle1;
	
	// swings
	AVItem *swing0;
	AVItem *swing1;
	AVItem *swing2;
	
	// Hits
	AVItem *hit0;
	AVItem *hit1;
	AVItem *hit2;
	
	// Strikes
	AVItem *strike0;
	AVItem *strike1;
	
	/*
	End sound objects
	*/
}
- (id)init;
- (void)dealloc;
- (void)playSoundOfType:(int)type;
- (void)playItem:(AVItem *)item;
- (void)itemFinishedPlaying:(id)fp8;
- (void)setBaseFilePath:(NSString *)path;
- (void)setTurnOnDelegate:(BOOL *)turnDelegate;
- (void)playRandomSwing;
- (void)playRandomHit;
- (void)playRandomStrike;
- (void)loadAllSoundsInBaseDir;
@end
